
#include <BSpring>
#include "member_BSpring.h"

using namespace BWE;

#define member					(*(member_BSpring*)_ptr)
#define member_allocate()		_ptr = new member_BSpring(this)
#define member_release()		delete (member_BSpring*)_ptr

BSpring::BSpring(const BString& name) : BObject(name)
{
	member_allocate();
}
BSpring::BSpring(float stretch)
{
	member_allocate();
	setSizeStretch(stretch);
}
BSpring::~BSpring()
{
	member_release();
}

void BSpring::setRect(int x, int y, int width, int height)
{
	member.rect.set(x, y, width, height);
}
void BSpring::setRect(const BRect& rect)
{
	member.rect = rect;
}
const BRect& BSpring::rect() const
{
	return member.rect;
}

void BSpring::setSizeHint(const BSize& hintSize)
{
	member.hintSize = hintSize;
}
const BSize& BSpring::sizeHint() const
{
	return member.hintSize;
}

void BSpring::setMinSize(const BSize& minSize)
{
	member.minSize = minSize;
}
const BSize& BSpring::minSize() const
{
	return member.minSize;
}

void BSpring::setMaxSize(const BSize& maxSize)
{
	member.maxSize = maxSize;
}
const BSize& BSpring::maxSize() const
{
	return member.maxSize;
}

void BSpring::setSizePolicy(const BSizePolicy& sizePolicy)
{
	member.sizePolicy = sizePolicy;
}
const BSizePolicy& BSpring::sizePolicy() const
{
	return member.sizePolicy;
}

void BSpring::setSizeStretch(float sizeStretch)
{
	member.sizeStretch = sizeStretch;
}
float BSpring::sizeStretch() const
{
	return member.sizeStretch;
}
